Repository navigation
ci: keep Loom models from drifting (shim lint + model-sync mapping) - #276
Conversation
concurrency/clippy.toml lists the atomics, locks and condvars Loom must see. Production shims re-export the same types, so the lint is allowed for the package and denied by each Loom harness on its #[path]-included core; the mailbox-loom job runs clippy under --cfg spawned_scheduler_loom, where every shim type is Loom's and a remaining std type is a direct use.
[loom.*] entries in verification/model-map.toml: a PR changing a core must change one of its Loom harnesses (in addition to any covering TLA+ model) or carry the no-model-change waiver. The models check requires every harness that includes production code to be mapped, with code equal to its includes.
🤖 Claude Code ReviewReview: PR #276, Loom model-drift guardsThe approach is sound. Running clippy under Correctness and coverage gaps1.
Either lint it like the others, or document why the bench prototype is exempt. 2. The harness list in the workflow is hardcoded.
So a new harness can satisfy
3.
Also, the reason string "use the 4. Possible override of a root config (
|
🤖 Codex Code Review
All 45 model-sync tests and the model inventory check pass. No production runtime behavior changes. The pinned-toolchain Clippy check could not run because rustup requires filesystem writes outside the permitted paths. Automated review by OpenAI Codex · gpt-6.1-sol · custom prompt |
🤖 Gemini Code ReviewThis PR looks good. The mechanism for enforcing shim usage in the Loom-checked cores via item-scoped Automated review by Gemini · gemini-4-argon · custom prompt |
🤖 Grok Code ReviewThe model-sync split is sound: TLA and Loom are independent gates, Bug: the Loom clippy job cannot fail
run: cargo clippy --locked -p spawned-concurrency --no-default-features --test mailbox_admission_loom --test reply_slot_loom --test registry_turn_loom --test job_core_loom --test link_fence_loom --test stop_token_loom -- -A warnings -D clippy::disallowed_types -D clippy::disallowed_methodsThat deny is crate-wide, not just the included core. Confirm the harnesses only spawn/synchronize through Gap:
|
🤖 DeepSeek Code ReviewThe PR only changes verification/tooling; no production concurrency code is touched. Overall the approach is good, but there are a few gaps in the enforcement scripts.
A minor note: confirm Automated review by DeepSeek · deepseek-v4-pro · custom prompt |
🤖 Kimi Code ReviewFindings
Otherwise, the split between TLA+ and Loom update requirements looks correct, including the case where a core needs both sides updated, and the map/include consistency tests cover the main inventory cases well. Automated review by Kimi (Moonshot AI) · kimi-k3.1-pro · custom prompt |
…marks; map the ReadyGate Loom harness to benchmarks/experiments
Keeps the Loom models from drifting away from the code they check.
1. Shim lint (
concurrency/clippy.toml)Bans direct
std::sync::{Mutex, MutexGuard, RwLock, Condvar, Barrier}, everystd::sync::atomic::Atomic*,parking_lot::{Mutex, MutexGuard, RwLock, Condvar, ReentrantMutex}andstd::sync::atomic::fence/std::thread::{spawn, yield_now}.Scope. The production
syncshims re-export the std/parking_lot types (zero cost), so clippy resolvessuper::sync::Mutexto the sameDefIdasstd::sync::Mutex: in an ordinary build the lint cannot tell a shim use from a direct one (tried: 224 hits crate-wide, including every shim import in the cores). So:concurrency/Cargo.tomlallowsdisallowed_types/disallowed_methodsfor the package (no change to any non-Loom code);#[deny(...)]on its#[path]-included coremod;mailbox-loomjob runscargo clippyon the six harnesses under--cfg spawned_scheduler_loom(with-A clippy::allso only the ban is enforced there), where every shim type is Loom's and anything left is a direct use.Negative control (local): appending a
std::sync::atomic::AtomicBoolstatic tostop_token/core.rsfails withuse of a disallowed type. No violations existed in the cores; no source file insrc/changes, so zero runtime cost.2. model-sync
New
[loom.*]entries inverification/model-map.toml(RegistryTurn, ReplySlot, JobCore, LinkFence, StopToken, MailboxAdmission, ReadyGate).pathsnow treats TLA+ models and Loom harnesses as two sides: a core covered by both needs one of each updated (comment-only harness changes don't count), or the existingno-model-changelabel + reason.modelsfails if a*/tests/*_loom.rsthat#[path]-includes production code is unmapped, or if an entry'scodediffers from what its harness includes. 10 new self-tests (negative controls included); 45 pass.Coverage floors and allowlists unchanged.
Model: no change because this PR only changes CI/lint configuration and Loom harness attributes.